<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<%@ include file="/WEB-INF/jsp/ResourceGlobal.jsp"%>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>没有权限进行此操作</title>
    <style>
    .main-box-container {
        padding: 20px 20px 0 20px;
        height: 100%;
    }
    
    .main-box {
        padding-top: 40px;
        height: 100%;
    }

    .main-box .ibox-content {
        width: 500px;
        height: 300px;
        overflow: auto;
        text-align: left;
        margin: 0 auto;
        border: 1px solid #e2e2e2;
    }
    .collapse-link {
        color: #489ae2;
    }
    .ico-error {
        width: 100px;
        color: #f50000;
        font-size: 85px;
    }
    </style>
</head>

<body>
    
    <div class="main-box-container full-width">
        <div class="text-center main-box white-bg ibox">
            <p class="m-md">
                <i><img src='<%=context%>/resources/modules/bootstrap/image/nonPrivileged.jpg'></i>
            </p>
              <p class="f-18" style="margin-bottom: 40px;color: #858585;">
                <c:choose>
	              	<c:when test="${type eq 'noLogin'}">
	              		抱歉，您已登录超时，请重新登录
	              	</c:when>
	              	<c:when test="${type eq 'nonPrivileged'}">
	              		抱歉，您目前没有权限进行此操作，请联系管理员
	              	</c:when>
	              	<c:otherwise>
	              		抱歉！您目前没有权限进行此操作，请重新登录或联系管理员
	              	</c:otherwise>
              	</c:choose>
              </p>
            <p>
               <!-- <a href="javascript:window.close();" class="btn btn-outline btn-default btn-w-m">关闭</a> -->
               <c:choose>
	               <c:when test="${type eq 'noLogin' }">
	                	<a href="javascript:toLoginWindow();" class="btn btn-outline btn-default btn-w-m">返回登录</a>
	                </c:when>
	                <c:otherwise>
<!-- 		                <button class="btn btn-outline btn-default btn-w-m" onclick="window.close();">关闭</button> -->
						<a href="javascript:history.back(-1);" class="btn btn-outline btn-default btn-w-m">返回</a>
	                </c:otherwise>
                </c:choose>
            </p>
        </div>
    </div>

<script type="text/javascript">
	var redireUrl = "${redireUrl}";
    $(function() {
        // Collapse ibox function
        $('.collapse-link').click(function() {
            var ibox = $(this).closest('div.ibox');
            var button = $(this).find('i');
            var content = ibox.find('.ibox-content');
            content.slideToggle(200);
            button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
            ibox.toggleClass('').toggleClass('border-bottom');
        });
    });

    function toLoginWindow(){
    	var windowArr = new Array();
    	var win = window;
	   	while (win.opener != null) {
	   		windowArr.push(win.opener);
	   		win = win.opener;
	   	};
		if (windowArr.length > 0) {
	    	for (var i = 0; i < windowArr.length - 1; i++) {
	    		windowArr[i].close();
	    	}
	    	windowArr[windowArr.length - 1].parent.location = redireUrl;
	    	window.close();
		} else {
			window.parent.location = redireUrl;
		}
	}
    </script>
</body>

</html>
